require "Dialogs"

Arena.Resize(565, 130)
Player.sprite.alpha = 0

timer = 0

function Update()
	DialogUpdate()
	if timer <= 60 then
		timer = timer + 1
	elseif timer == 61 then
		Bubble("[noskip][font:sans][voice:sans]...", "leftwide", 230, 320, 10, 90, 1)
		timer = 62
	elseif timer == 62 and Bubbles[1] and not Bubbles[1].Activo then
		Encounter.Call("SetSansHead", "Worried")
		if GetAlMightyGlobal("Idioma") == "Spanish" then
			Bubble("[noskip][font:sans][voice:sans]bueno[w:10], supongo que...", "leftwide", 230, 320, 10, 90, 1)
		else
			Bubble("[noskip][font:sans][voice:sans]well[w:10], i guess you...", "leftwide", 230, 320, 10, 90, 1)
		end
		timer = 63
	elseif timer == 63 and Bubbles[1] and not Bubbles[1].Activo then
		Encounter.Call("SetSansHead", "zzz")
		Bubble("[noskip][font:sans][voice:sans]. . .", "leftwide", 230, 320, 10, 90, 1)
		timer = 64
	elseif timer == 64 and Bubbles[1] and not Bubbles[1].Activo then
		Encounter.Call("SetSansHead", "Wink")
		Encounter.Call("SetHead", "Disgust")
		if GetAlMightyGlobal("Idioma") == "Spanish" then
			Bubble("[noskip][font:sans][voice:sans]nah[w:10], solo bromeo.[w:10][func:SetSansHead,Joking]\nheheheheheh.", "leftwide", 230, 320, 10, 90, 1)
		else
			Bubble("[noskip][font:sans][voice:sans]nah[w:10], i'm just joking.[w:10][func:SetSansHead,Joking]\nheheheheheh.", "leftwide", 230, 320, 10, 90, 1)
		end
		Encounter["Sans"]["Legs"].MoveTo(410, 261)
		Encounter["Sans"]["Legs"].Set("Sans/Legs")
		Encounter["Sans"]["Body"].MoveTo(-2, 48)
		Encounter["Sans"]["Body"].Set("Sans/Body/Joking")
		Encounter["Sans"]["Head"].MoveTo(0, 43)
		Encounter["Sans"]["Animation"] = "Normal"
		NewAudio.Play("Loop")
		timer = 65
	elseif timer == 65 and Bubbles[1] and not Bubbles[1].Activo then
		Player.sprite.alpha = 1
		Encounter["NoChange"] = nil
		Encounter["Sans"]["Body"].Set("Sans/Body/Left")
		Encounter["nextwaves"] = {"Attack 11"}
		State("DEFENDING")
	end
end